stylecontext: Don't use bg image in gtk_style_context_set_background()
authorBenjamin Otte <otte@redhat.com>
Fri, 26 Oct 2012 21:33:40 +0000 (23:33 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 31 Oct 2012 10:09:10 +0000 (11:09 +0100)
Old code tried to use the "background-image" proeprty for setting the
default image background. While this used to work in the early days of
GTK3, today it is grossly misleading as the backgronud image may be
resized, repositioned and semi-translucent which causes very weird
artifacts when rendering.

So we use the background-color only instead.

gtk/gtkstylecontext.c

index a6b7369b342fe72da34cc2be89f9bc82bc0fd33e..a139d392430bb0cde098b92ddfe4828220e28a3b 100644 (file)
@@ -3264,22 +3264,12 @@ gtk_style_context_set_background (GtkStyleContext *context,
                                   GdkWindow       *window)
 {
   GtkStateFlags state;
-  cairo_pattern_t *pattern;
   GdkRGBA *color;
 
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
   g_return_if_fail (GDK_IS_WINDOW (window));
 
   state = gtk_style_context_get_state (context);
-  gtk_style_context_get (context, state,
-                         "background-image", &pattern,
-                         NULL);
-  if (pattern)
-    {
-      gdk_window_set_background_pattern (window, pattern);
-      cairo_pattern_destroy (pattern);
-      return;
-    }
 
   gtk_style_context_get (context, state,
                          "background-color", &color,